/*
 * DataReader.h
 *
 *  Created on: Oct 1, 2010
 *      Author: blyth
 */

#ifndef SIMDATAREADER_H_
#define SIMDATAREADER_H_

#include <TFile.h>
#include <TH1D.h>
#include <TTree.h>
#include <sstream>
#include <dataForm.h>
using namespace std;

class SimDataReader {
public:
	SimDataReader(char*, int);
	virtual ~SimDataReader();

	bool ReadNext(double&, double&, int&);

private:
	void cleanup();

	dataForm data;
	TFile* file;
	TBranch* dataBranch;
	TBranch* OEVBranch;
	int index;
	int photon;
	stringstream ss;
	TTree* tree;
	const int maxPhotons;
};

#endif /* SIMDATAREADER_H_ */
